package com.wuyu.mini.spring.mvc.render;

import com.wuyu.mini.spring.mvc.processor.RequestProcessorChain;
import javax.servlet.http.HttpServletResponse;

/**
 * 内部异常渲染器
 */
public class InternalErrorResultRender implements ResultRender {

    private String errorMsg;

    public InternalErrorResultRender(String  errorMsg){
        this.errorMsg = errorMsg;
    }

    public void render(RequestProcessorChain requestProcessorChain) throws Exception {
        requestProcessorChain.getResponse().sendError(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, errorMsg);
    }
}
